import { ref } from "vue";

// 防抖
export default function useDebounce(fn, wait) {
    const timer = ref()
    return function (...args) {
        clearTimeout(timer.value)
        timer.value = setTimeout(() => {
            fn(...args)
        }, wait);
    }
}